<template>
  <div>
    <page-main>
      <!-- <el-button size="mini" type="primary" @click="addEditSocialUnit">添加</el-button> -->
      <el-table :data="tableData" v-loading="tableLoading">
        <el-table-column label="id" prop="building_id"></el-table-column>
        <el-table-column label="建筑名称" prop="architecture_name">
        </el-table-column>
        <el-table-column label="所属单位" prop="name"> </el-table-column>
        <el-table-column label="地址" prop="address"> </el-table-column>
        <el-table-column label="总面积" prop="total_area"> </el-table-column>
        <el-table-column label="总层数" prop="total_floor"> </el-table-column>
      </el-table>
      <div class="block">
        <el-pagination
          :current-page="pagination.page"
          :total="total"
          :page-size="pagination.size"
          :page-sizes="pagination.sizes"
          :layout="pagination.layout"
          class="pagination"
          background
          @size-change="onSizeChange"
          @current-change="onCurrentChange"
        />
      </div>
    </page-main>
  </div>
</template>
<script>
import paginationMixin from "@/mixins/pagination";
export default {
  // 分页
  mixins: [paginationMixin],
  data() {
    return {
      tableLoading: false,
      tableData: [],
      tableDataInfo: "",
    };
  },
  created() {
    this.getDataList();
  },

  methods: {
    getDataList() {
      this.tableLoading = true;
      let unit_id = localStorage.getItem('fa_user_info')
      // 分页
      let params = {
        rows: this.pagination.size,
        page: this.pagination.page,
        type: "overtimeHighBuildingUnitTotal",
        unit_id:JSON.parse(unit_id).unit_id
      };
      
      console.log(JSON.parse(unit_id).unit_id);
      //   获取列表
      this.$api
        .post("/unit/Dashboard/dangerList", params)
        .then((res) => {
          this.tableData = res.data.list;
          this.tableDataInfo = res.data;
          this.total = res.data.total;
         
        })
        .finally(() => {
          this.tableLoading = false;
        });
    },
  },
};
</script>
<style scoped lang="scss" >
.block {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}
:deep(.el-textarea__inner) {
    height: 100px;
}
.mapBox {
    width: 100%;
    height: 600px;
    #container {
        z-index: 100;
        width: 100%;
        height: 500px;
    }
    .btnBox {
        margin-top: 20px;
        display: flex;
        justify-content: center;
    }
    .search {
        display: flex;
        span {
            width: 100px;
            line-height: 40px;
            text-align: center;
        }
    }
}
.searchBox {
    margin: 20px;
    display: flex;
    background-color: #fff;
    padding: 20px;
    .input {
        width: 10%;
        margin-right: 15px;
    }
    .hint {
        line-height: 40px;
        margin-right: 10px;
    }
    .searchBtn {
        background-color: #2d8cf0;
        color: #fff;
    }
}
// .block {
//     margin-top: 10px;
//     display: flex;
//     justify-content: center;
// }
</style>
